|
| 1 | +{ |
| 2 | + "mode": "file_to_file", |
| 3 | + "file_a": "before.py", |
| 4 | + "file_b": "after.py", |
| 5 | + "comparison": { |
| 6 | + "general_object_comparison": { |
| 7 | + "identity": { |
| 8 | + "same_object_identity": false, |
| 9 | + "same_type": true, |
| 10 | + "type_a": "builtins.str", |
| 11 | + "type_b": "builtins.str" |
| 12 | + }, |
| 13 | + "exactness": { |
| 14 | + "python_equality_operator": false, |
| 15 | + "repr_exact_match": false, |
| 16 | + "json_exact_match": false, |
| 17 | + "json_hash_a": "e1428c62183596ba10d7823e3a78440f86692b2312e79786370f0e12ac4b84a9", |
| 18 | + "json_hash_b": "d68c9d251bf2f1a177c72951e0b32128f8ba5bdb3f760d815857c17fa0931584" |
| 19 | + }, |
| 20 | + "similarity": { |
| 21 | + "repr_sequence_similarity": 0.6824644549763034, |
| 22 | + "json_sequence_similarity": 0.676056338028169, |
| 23 | + "json_line_similarity": 0.0, |
| 24 | + "json_token_jaccard_similarity": 0.6956521739130435, |
| 25 | + "json_token_multiset_overlap": 0.5869565217391305 |
| 26 | + }, |
| 27 | + "python_source_comparison": { |
| 28 | + "source_available_a": true, |
| 29 | + "source_available_b": true, |
| 30 | + "source_exact_match": false, |
| 31 | + "source_normalized_text_similarity": 0.6702127659574468, |
| 32 | + "source_line_similarity": 0.0, |
| 33 | + "source_token_jaccard_similarity": 0.6190476190476191, |
| 34 | + "source_token_multiset_overlap": 0.5833333333333334, |
| 35 | + "ast_normalized_exact_match": false, |
| 36 | + "ast_normalized_similarity": 0.6767676767676768, |
| 37 | + "ast_dump_exact_match": false, |
| 38 | + "ast_dump_similarity": 0.3274336283185841 |
| 39 | + }, |
| 40 | + "previews": { |
| 41 | + "repr_a": "'def normalize_name(value: str) -> str:\\n return value.strip().lower()\\n'", |
| 42 | + "repr_b": "'def normalize_name(value: str, *, empty: str = \"unknown\") -> str:\\n cleaned = value.strip().lower()\\n return cleaned or empty\\n'", |
| 43 | + "json_a": "\"def normalize_name(value: str) -> str:\\n return value.strip().lower()\\n\"", |
| 44 | + "json_b": "\"def normalize_name(value: str, *, empty: str = \\\"unknown\\\") -> str:\\n cleaned = value.strip().lower()\\n return cleaned or empty\\n\"" |
| 45 | + } |
| 46 | + }, |
| 47 | + "function_specific_comparison": { |
| 48 | + "function_like_comparison_possible": true, |
| 49 | + "features_a": { |
| 50 | + "function_found": true, |
| 51 | + "name": "normalize_name", |
| 52 | + "signature": { |
| 53 | + "name": "normalize_name", |
| 54 | + "is_async": false, |
| 55 | + "positional_only": [], |
| 56 | + "positional_or_keyword": [ |
| 57 | + "value" |
| 58 | + ], |
| 59 | + "vararg": null, |
| 60 | + "keyword_only": [], |
| 61 | + "kwarg": null, |
| 62 | + "arg_count_total": 1, |
| 63 | + "decorator_count": 0 |
| 64 | + }, |
| 65 | + "body_normalized": "return value.strip().lower()", |
| 66 | + "body_ast_dump": "Module(body=[Return(value=Call(func=Attribute(value=Call(func=Attribute(value=Name(id='value', ctx=Load()), attr='strip', ctx=Load())), attr='lower', ctx=Load())))])", |
| 67 | + "return_count": 1, |
| 68 | + "yield_count": 0, |
| 69 | + "call_names": [], |
| 70 | + "attribute_call_names": [ |
| 71 | + "lower", |
| 72 | + "strip" |
| 73 | + ], |
| 74 | + "raises": 0, |
| 75 | + "branch_count": 0, |
| 76 | + "loop_count": 0, |
| 77 | + "comprehension_count": 0, |
| 78 | + "string_literals": [] |
| 79 | + }, |
| 80 | + "features_b": { |
| 81 | + "function_found": true, |
| 82 | + "name": "normalize_name", |
| 83 | + "signature": { |
| 84 | + "name": "normalize_name", |
| 85 | + "is_async": false, |
| 86 | + "positional_only": [], |
| 87 | + "positional_or_keyword": [ |
| 88 | + "value" |
| 89 | + ], |
| 90 | + "vararg": null, |
| 91 | + "keyword_only": [ |
| 92 | + "empty" |
| 93 | + ], |
| 94 | + "kwarg": null, |
| 95 | + "arg_count_total": 2, |
| 96 | + "decorator_count": 0 |
| 97 | + }, |
| 98 | + "body_normalized": "cleaned = value.strip().lower()\nreturn cleaned or empty", |
| 99 | + "body_ast_dump": "Module(body=[Assign(targets=[Name(id='cleaned', ctx=Store())], value=Call(func=Attribute(value=Call(func=Attribute(value=Name(id='value', ctx=Load()), attr='strip', ctx=Load())), attr='lower', ctx=Load()))), Return(value=BoolOp(op=Or(), values=[Name(id='cleaned', ctx=Load()), Name(id='empty', ctx=Load())]))])", |
| 100 | + "return_count": 1, |
| 101 | + "yield_count": 0, |
| 102 | + "call_names": [], |
| 103 | + "attribute_call_names": [ |
| 104 | + "lower", |
| 105 | + "strip" |
| 106 | + ], |
| 107 | + "raises": 0, |
| 108 | + "branch_count": 0, |
| 109 | + "loop_count": 0, |
| 110 | + "comprehension_count": 0, |
| 111 | + "string_literals": [ |
| 112 | + "unknown" |
| 113 | + ] |
| 114 | + }, |
| 115 | + "name_exact_match": true, |
| 116 | + "signature_exact_match": false, |
| 117 | + "signature_similarity": 0.47901234567901235, |
| 118 | + "body_normalized_exact_match": false, |
| 119 | + "body_normalized_similarity": 0.5783132530120482, |
| 120 | + "body_ast_exact_match": false, |
| 121 | + "body_ast_similarity": 0.16842105263157894, |
| 122 | + "call_name_jaccard_similarity": 1.0, |
| 123 | + "attribute_call_name_jaccard_similarity": 1.0, |
| 124 | + "string_literal_jaccard_similarity": 0.0, |
| 125 | + "structure_similarity_summary": 0.6451493302645279, |
| 126 | + "likely_relationship": "possible_variant" |
| 127 | + } |
| 128 | + } |
| 129 | +} |
0 commit comments